-
Notifications
You must be signed in to change notification settings - Fork 3
[NO TICKET] Fix_database_cmd_warnings #331
base: develop
Are you sure you want to change the base?
Conversation
bcce9d3
to
b48d37a
Compare
b48d37a
to
fe7fd36
Compare
// PostgreSQL: translate DROP INDEX for names that are actually unique constraints | ||
if($this->conn->driver == 'Cake\Database\Driver\Postgres' | ||
&& preg_match('/^DROP INDEX\s+"?([a-zA-Z0-9_\.]+)"?/i', $sql, $m)) { | ||
$idxOrConstraint = $m[1]; | ||
|
||
// Resolve if this name is a constraint and on which table | ||
$qualifiedTable = $this->resolvePgConstraintTable($idxOrConstraint); | ||
|
||
if($qualifiedTable !== null) { | ||
// We will skip this index if it's bound to a constraint | ||
if($this->io) $this->io->out('Skipping index:' . $m[1] . ' drop since it is bound to a constraint'); | ||
continue; | ||
} | ||
} | ||
|
||
// PostgreSQL: make index renames idempotent and tolerant using IF EXISTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try getting these issues addressed upstream rather than having to patch around DBAL behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benno Before we can begin implementing changes, I believe it is essential to first upgrade to the latest version, which is currently 4.3. Once the system is up to date, we can start evaluating and suggesting modifications. For instance, introducing changes such as ALTER INDEX IF EXISTS
should be considered early in the process. However, our initial priority should be to complete the version upgrade.
After upgrading, I would like to reassess these changes. This will allow us to determine whether the latest upstream code addresses our concerns or if any issues remain. The goal of this pull request is twofold: first, to resolve any issues or warnings reported at runtime via the command line, which can be confusing for deployers; and second, to address deprecations in preparation for the upgrade.
As part of the 5.2.7 upgrade, I have updated DBAL to the latest 3.x release for stability. Once we are running the most recent version of CakePHP, we can safely move to the latest DBAL and begin making further improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c7cc368
to
8dcf207
Compare
No description provided.